﻿using IFramework;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class TestCycArray : MonoBehaviour
{
    class test
    {
        public int val;
        public test(int val)
        {
            this.val = val;
        }
    }
    void Start()
    {
        CycArray<test> cycArray = new CycArray<test>();
        for (int i = 0; i < 7; i++)
        {
            cycArray.Add(new test(i));
            //Debug.Log(cycArray.Count + ":" + cycArray.Capacity);
        }
        //Debug.Log(cycArray.Count + ":" + cycArray.Capacity);
        //test t = new test(222);
        //cycArray.Insert(0, t);
        //Debug.Log(cycArray.Contains(t));
        //Debug.Log(cycArray.IndexOf(t));

        // Debug.Log(cycArray.DeQueue().val + ":" + cycArray.Capacity);
        //for (int i = 0; i < cycArray.Count; i++)
        //{
        //    if (cycArray.Array[i].val == 5)
        //    {
        //        cycArray.ReMove(cycArray.Array[i]);
        //        //cycArray.Add(new test(i));
        //        break;
        //    }
        //}
        //Debug.Log(cycArray.DeQueue().val);
        //Debug.Log(cycArray.StackPop().val);
        //Debug.Log(cycArray.StackPop().val);
        //Debug.Log(cycArray.StackPop().val);
        //Debug.Log(cycArray.DeQueue().val);
        //Debug.Log(cycArray.DeQueue().val);
        //cycArray.Add(new test(222));

        Debug.Log(cycArray.Count + ":" + cycArray.Capacity);
        //for (int i = 0; i < cycArray.Count; i++)
        //{
        //    Debug.Log(cycArray[i].val);
        //}
        foreach (var item in cycArray)
        {
            Debug.Log(item.val);
        }



    }

    // Update is called once per frame
    void Update()
    {
        
    }
}
